/*
 * Copyright (c) 2010 Sylvestre Gallon <syl@pmbsd.org>
 *
 * Permission to use, copy, modify, and distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice appear in all copies.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 */

#ifndef __OBJC_H__
#define __OBJC_H__

struct objc_class;
struct mboot_info;
struct objc_module;

typedef struct objc_object {
        struct objc_class *cl;
} *id;

typedef struct objc_selector {
        void *sel_id;
        const char *sel_types;
} *SEL;

typedef id (*IMP)(id, SEL, ...);

#define nil (id)0;

extern void __objc_perform_ctor(void);
extern void *__objc_malloc(size_t size);
extern void __objc_free(void *p);
void __objc_exec_class(struct objc_module *module);

#endif /* __OBJC_H__ */
